import request from "@/apis/request";

export const findProductionSceduling = async (form) => {
    return await request.get('/api/ProductionScheduling/find', {
        params: form
    })
}

export const taskFindProcess = async (productCode) => {
    console.log(productCode)
    return await request.get('/api/ProductionScheduling/findProcess', {
        params: {productCode: productCode}
    })
}

export const findProTask = async (form) => {
    return await request.get('/api/feedback/findProTask', {
        params: form
    })
}

export const findProcess = async (workorderCode, processCode) => {
    return await request.get('/api/ProductionScheduling/Query', {
        params: {workorderCode, processCode}
    })
}
export const insertTask = async (form) => {
    return await request.post("/api/ProductionScheduling/insert", JSON.stringify(form), {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}
export const updateTask = async (form) => {
    return await request.put("/api/ProductionScheduling/update", JSON.stringify(form), {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}

export const deleteTask = async (id) => {
    return await request.delete("/api/ProductionScheduling/delete", {data: id});
}
